<template>
	<view class="control">
		<view class="control_item" v-for="(item, index) in data" :key="index" @click="change(item)">
			<view class="control_item_name">
				{{item.name}}
			</view>
			<rui-icons :icon="item.category == 'path' || item.category == 'custom' ? 'right':'more'" color="#999"></rui-icons>
		</view>
	</view>
</template>

<script setup>
	defineProps({
		data: Array
	})

	const emits = defineEmits(['change']);
	const change = (e) => {
		emits('change', e)
	}
</script>

<style lang="scss" scoped>
	.control {
		margin-top: 50rpx;

		&_item {
			margin: 20rpx;
			background: #fff;
			padding: 40rpx;
			border-radius: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			&:active{
				background: #eee;
			}
		}
	}
</style>